package com.bigflexlib.x.flash.filesystem
{
	import com.bigflexlib.core.markers.IIncomplete;
	
	import flash.filesystem.File;
	
	public class FileUtil implements IIncomplete
	{


		public static function changeExtensionsRecursive( dir:File, fromExt:String, toExt:String ):void
		{
		
			if ( !dir.isDirectory )
				return;
				
			
			var list:Array = dir.getDirectoryListing( );
			for each ( var child:File in list )
			{
				if ( child.isDirectory )
				{
					changeExtensionsRecursive( child, fromExt, toExt );
					continue;
				}	
				
				if ( child.extension != fromExt )
				{
					continue;
				}
				
				var path:String = child.nativePath.substr( 0, -fromExt.length )
				child.moveToAsync( new File( path + toExt ) );
			
			}
		
		}
		
		


	}
}